<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<script type="text/javascript">
	$(document).ready(function() {
		$("#editCountryForm").validate({
			rules : {
				name : {
					required : true
				}
			}
		});
	});
</script>
<div id="editCountryDiv">
	<div id="menu-heading">
		<spring:message code="editCountry.heading" />
	</div>
	<form:form name="editCountryForm" id="editCountryForm" action="saveCountry.do" method="post" modelAttribute="country">
		<form:hidden path="id" />
		<table>
			<tr class="row">
				<td class="label">&nbsp;</td>
				<td class="input-field" colspan="2">
					<%@ include file="/common/messages.jsp" %>
				</td>
			</tr>
			<tr class="row">
				<td class="label"><spring:message code="editCountry.label.region" /></td>
				<td class="input-field"><form:select path="region.id">						
				    <form:options items="${regionList}" itemValue="id" itemLabel="displayName" />
					</form:select></td>
				<td><form:errors path="region.id" cssClass="error" /></td>
			</tr>
			<tr class="row">
				<td class="label"><spring:message code="editCountry.label.displayName" /></td>
				<td class="input-field"><form:input path="displayName" cssClass="input-full-width" /></td>
				<td><form:errors path="displayName" cssClass="error" /></td>
			</tr>
		    <tr class="row">
				<td class="label"><spring:message code="cipeprojectlist.table.heading.programOfficer" /></td>
				<td class="input-field">
				<form:select path="programOfficer.id">						
				    <form:options items="${users}" itemValue="id" itemLabel="fullName" />
					</form:select>
				</td>
				<td><form:errors path="displayName" cssClass="error" /></td>
			</tr>
		  <tr class="row">
				<td class="label"><spring:message code="cipeprojectlist.table.heading.programAssistant" /></td>
				<td class="input-field">
				<form:select path="programAssistant.id">						
				   <form:options items="${users}" itemValue="id" itemLabel="fullName" />
					</form:select>
				</td>
				<td><form:errors path="displayName" cssClass="error" /></td>
			</tr>		
			
			<tr class="row">
				<td class="label">&nbsp;</td>
				<td class="input-field"><sj:submit id="CountryFormSubmit" target="editCountryDiv" key="editCountry.button.save" validate="true" /> <input type="reset" value="<spring:message code='editCountry.button.cancel' />" /></td>
				<td>&nbsp;</td>
			</tr>
		</table>
	</form:form>
</div>